#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<string.h>
#include<stdlib.h>

#define NUM 256
#define FLUSH_ALL 1
#define FLUSH_LINE 2
typedef struct _MYFILE
{
    int fd;
    int flag; //缓冲区刷新策略
    char buff[NUM];
    int currant;
}MYFILE;


MYFILE* myfopen(const char *path, const char *mode);

int myfclose(MYFILE *fp);

size_t myfwrite(const void *ptr, size_t size, size_t nmem, MYFILE *stream);

int myfflush(MYFILE *stream);
